<template>
	<view class="foodpage">
	   <view class="userdate" v-if="user.memberLevel!=0">
	   	 <view class="iconfont icon-fuwu1">
	   	 	
	   	 </view>
		 用户{{user.memberName||'新用户'}}专病服务 第 
		 <view class="day">
		 	{{day||'0'}}
		 </view>
		 天 剩余
		  <view class="sheng">
		  	{{shengyu||'0'}}
		  </view>
		  天
	   </view>

<view class="foodbox">
	<view class="titleline">
		<view class="left">
			医嘱解读和执行指导
		</view>
		<view class="lable" @click="goyizhulist">
			查看所有
		</view>
	</view>
	<view class="list">
		<view class="itemfood" v-for="(item,index)  in yizhulist" :key="index"  @click="yizhudetail(item)">
			<image :src="'https://changban.dianjingkeji.net/prod-api'+item.yzImg[0]" mode=""></image>
			<view class="itemtype">
				{{item.yzStatus==0?'待确认':item.yzStatus==1?'待提交':item.yzStatus==2?'待审核':item.yzStatus==3?'审核中':'已生成'}}
			</view>
			<view class="itemname">
				{{item.yzTitle}}
			</view>
		</view>
		
	</view>
</view>


<view class="foodbox">
	<view class="titleline">
		<view class="left">
			事件提醒（用户自我管理记录）
		</view>
	
	</view>
	<view class="list">
		<view class="itemfood" @click="evenlist(item)" v-for="(item,index) in shijianlist" :key="index" >
			<image src="https://changban.dianjingkeji.net/img/治疗.png" mode=""></image>
			<view class="itemname">
				{{item.dictLabel}}
			</view>
		</view>
		
	</view>
</view>
<view class="foodbox">
	<view class="titleline">
		<view class="left">
			关键行动（医护团队下发）
		</view>
		
	</view>
	<view class="list">
		<view class="itemfood" v-for="(item,index) in guanjianlist" :key="index" @click="goguanjianxingdong(item)">
			<image src="https://changban.dianjingkeji.net/img/治疗.png" mode=""></image>
			<view class="itemname">
				{{item.dictLabel}}
			</view>
		</view>
	
	</view>
</view>

   
	
	
	</view>
</template>

<script>

	 import {medicalOrders,getDictData,getInfo,memberDetail} from '../../utils/api.js'
	export default {
		data() {
			
			return {
			memberid:'',
			guanjianlist:[],
			shijianlist:[],
			yizhulist:[],
			day:'',
			shengyu:'',
			user:{}
			}
		},
	    onLoad(e) {
	    	this.memberid=e.id
	    },
		onShow() {
			let a ={
				phone:uni.getStorageSync('phone'),
				memberId:this.memberid
			}
					medicalOrders(a).then(res=>{
						const newData = res.data.data.orderList.map(item => ({
						  ...item,
						  yzImg:item.yzImg.split(',')
						}));
						console.log(newData,'这是处理过的数据')
						this.yizhulist=newData
						this.day=res.data.data.cpServiceCurrentDays
						this.shengyu=res.data.data.cpServiceRemainingDays
						this.user=res.data.data.info
					})
				
			let b={
				type:'sys_shijiantixingbiaoqian'
			}
			getDictData(b).then(res=>{
				
				this.shijianlist=res.data.data
			})
			let c={
				type:'sys_guanjianxingdongbiaoqian'
			}
			getDictData(c).then(res=>{
				
				this.guanjianlist=res.data.data
			})
		
			
		},
		methods: {
			goguanjianxingdong(e){
				
				let label=e.dictValue
				uni.navigateTo({
					url:'/pagesB/remind/remind?label='+label+'&id='+this.memberid
				})
				
			
			},
			//点击事件类型 查看同类型事件
			evenlist(e){
				let label=e.dictValue
				uni.navigateTo({
					url:'/pagesA/changjing/changjing?label='+label+'&id='+this.memberid
					
				})
			},
			goyizhulist(){
				if(this.user.memberLevel==3){
					uni.navigateTo({
						url:'/pagesB/yizhulist/yizhulist?id='+this.memberid
					})
				}
			},
			goplan(){
					let sid=this.user.serviceId
					uni.navigateTo({
						url:'/pagesB/plan/plan?sid='+sid
					})
				
			},

			
			lookgengduo(){
				uni.navigateTo({
					url:'/pagesB/plan/plan'
				})
			},
			
			yizhudetail(e){
			
				if(e.yzStatus!=4){
					uni.showToast({
						title: '等待专家审定',
						icon:'none',
						duration: 2000
					});
			           return
				}
				let id=e.id
				uni.navigateTo({
					url:'/pagesB/yizhudetail/yizhudetail?id='+id
				})
				
			},
			
			
		
					
			
			
	
			
			

		
								
			
		}
	}
</script>

<style lang="less" scoped>
.foodpage{
	width: 750rpx;
	box-sizing: border-box;
	background: linear-gradient(180deg, rgba(242,248,255,1) 0%,rgba(242,248,255,1) 100%);
	padding-bottom: 200rpx;
	.userdate{
		width: 100%;
		background-color: #FFFCF6 ;
		font-size: 26rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-weight: bold;
		color: gray;
		padding: 12rpx 0;
		.day{
			font-size: 30rpx;
			color: black;
			
		}
		.sheng{
			font-size: 30rpx;
			color: #FF4D00 ;
		}
	}
	.card{
		width: 96%;
		height: 300rpx;
		margin: 30rpx auto;
		text-align: center;
		line-height: 300rpx;
		border-radius: 30rpx;
		color: white;
		font-weight: bold;
		font-size: 44rpx;
		background-color: #1A4F8A;
		box-shadow: 0 0 10rpx raba(0,0,0,0.5);
		image{
			width: 100%;
			height: 100%;
			border-radius: 30rpx;
		}
		
	}

	.weekline{
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 40rpx 0;
		background-color: white;
		.week{
			margin: 0 30rpx;
			font-weight: bold;
			color: #1A4F8A;
			font-size: 32rpx;
			font-family: OPPOSans-black;
			display: flex;
			align-items: center;
			.picker{
				display: flex;
				align-items: center;
				position: relative;
			}
			.iconfont{
				color:#5c6fac;
				
			}
		}
		
	}
	.back{
		width: 100%;
		height: 120rpx;
		background-color: white;
		.datetab{
			width: 90%;
			height: 110rpx;
			display: flex;
			box-sizing: border-box;
			padding: 10rpx;
			border-radius: 20rpx;
			margin: auto;
			background-color: #F4F4F4 ;
			color:#656565  ;
			line-height: 90rpx;
			.itemdate{
				width:33%;
				height: 100%;
				text-align: center;
				border-radius: 20rpx;
			}
			.act{
				background-color: white;
				font-weight: bold;
				color: #494949 ;
			}
			
		}
	}
		.chartbox{
			width: 100%;
			box-sizing: border-box;
			background-color: white;
			margin-top: 20rpx;
			padding: 20rpx 20rpx 40rpx 30rpx;
			.boxtitle{
				font-size: 30rpx;
				font-weight: bold;
				border-left: 8rpx solid #1A4F8A;
				height: 30rpx;
				padding-left: 30rpx;
				line-height: 30rpx;
			}
			.topbox{
				width: 100%;
				
				display: flex;
				align-items: center;
				justify-content: space-between;
				box-sizing: border-box;
				padding-left: 10rpx;
				margin-top: 30rpx;
				.chart1box{
					width: 600rpx;
					height: 400rpx;
					
					
				}
				.rightbanner{
					.itembanner{
						width: 120rpx;
						height: 120rpx;
						border-radius: 20rpx;
						background-color: #1A4F8A;
						color: white;
						text-align: center;
						box-sizing: border-box;
						padding-top: 20rpx;
						margin-top: 10rpx;
						.name{
							font-weight: bold;
							font-size: 34rpx;
						}
						.label{
							font-size: 26rpx;
							color: rgba(255,255,255,0.7);
							
						}
					}
					
				}
			}
		}
		
		
		.waitbox{
			width: 100%;
			
			background-color: white;
			margin: 20rpx 0;
			box-sizing: border-box;
			padding: 20rpx;
			.waittile{
				font-weight: bold;
				position: relative;
				.line{
					position: absolute;
					width: 66rpx;
					height: 8rpx;
					background-color: #1A4F8A;
					border-radius: 4rpx;
				bottom: 0;
				left: 0;
				}
			}
			.waitlabel{
				display: flex;
				align-items: center;
				line-height: 2.2;
				.num{
					color: #1A4F8A;
					font-weight: bold;
				}
			}
	     
		}
	
	



	.foodbox{
		width: 100%;
		background-color: white;
		margin-top: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		.titleline{
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 30rpx;
			line-height: 30rpx;
			.left{
				border-left: 6rpx solid #1A4F8A;
			    font-size: 30rpx;
					font-weight: bold;
					padding-left: 14rpx;
					color: #575757;
			}
			.lable{
				font-size: 26rpx;
				color: gray;
				font-weight: bold;
			}
		}
		.suifangbox{
					  width: 100%;
					  display: flex;
					  align-items: center;
					  justify-content: space-evenly;
					  .itemsuifang{
						  width: 48%;
						  margin: 1%;
						  border-radius: 20rpx;
						  box-sizing: border-box;
						  padding: 20rpx;
						  background: whitesmoke;
						  position: relative;
						  .suifangname{
							  font-size: 34rpx;
							  font-weight: bold;
						  }
						  .suifangline{
							  display: flex;
							  align-items: center;
							  font-size: 28rpx;
							  line-height: 2;
							  .suifangnum{
								  font-weight: bold;
								  font-size: 32rpx;
								  margin: 0 10rpx;
								  color: #1A4F8A;
							  }
							
						  }
						  .baodaotime{
							  font-size: 26rpx;
						  }
						  .baodao{
						  	
							position: absolute;
							background-color: white;
							padding: 4rpx 10rpx;
							border-radius: 6rpx;
							right: 4rpx;
							top: 8rpx;
						  }
						  .detail{
							  text-align: right;
							  color: #1A4F8A;
							   font-size: 30rpx;
						  }
						  
					  }
		}
		.list{
			width: 100%;
			overflow-x: auto;
			margin: 20rpx 0;
			display: flex;
			align-items: center;
			.add{
				background-color:#e0e0e0  !important;
				text-align: center;
				.iconfont{
					font-size: 50rpx;
					line-height:180rpx;
					margin: auto;
				}
				
			}
			
			.itemfood{
				width: 250rpx;
				min-width: 250rpx;
				height: 180rpx;
				border-radius: 30rpx;
				position: relative;
				margin-right: 30rpx;
				image{
					width: 100%;
					height: 100%;
					border-radius: 30rpx;
				}
				.itemtype{
					width: 50%;
					height: 42rpx;
					position: absolute;
					top: 0;
					right: 0;
				
					color: green;
					font-weight: bold;
					border-top-right-radius: 30rpx;
					text-align: center;
					line-height: 42rpx;
					font-size: 24rpx;
				}
				.itemname{
					width: 100%;
					height: 42rpx;
					position: absolute;
					bottom: 0;
					left: 0;
					background-color: rgba(0, 0, 0, 0.5);
					color: white;
					border-bottom-left-radius: 30rpx;
					border-bottom-right-radius: 30rpx;
					text-align: center;
					line-height: 42rpx;
					font-size: 24rpx;
					
				}
			}
		}
	}
	.winpage{
		width: 750rpx;
		height: 100vh;
		position: fixed;
		left: 0;
		top: 0;
		border: 0;
		right: 0;
		background-color: rgba(0, 0, 0, 0.5);
		.icon-guanbi{
			position: absolute;
			right: 40rpx;
			top: 14vh;
			color: white;
		}
		.win{
			width: 74%;
			height: 65vh;
			position: absolute;
			left: 13%;
			top: 12vh;
			background-color: white;
			border-radius: 24rpx;
			.wintop{
				width: 100%;
				height: 200rpx;
				box-sizing: border-box;
				padding: 20rpx;
				
				display: flex;
				align-items: center;
				border-top-right-radius: 24rpx;
				border-top-left-radius: 24rpx;
				font-weight: 800;
				line-height: 2;
				background: linear-gradient(180deg, rgba(214,241,253,1) 0%,rgba(162,225,254,1) 100%);
				.iconfont{
					font-size: 100rpx;
					font-weight: 300;
					color: #0075FF ;
					margin-right: 20rpx;
				}
			}
			.pickerbox{
				width: 100%;
				box-sizing: border-box;
				padding: 30rpx;
				.pickertitle{
					text-align: center;
                     font-size: 30rpx;
					 font-weight: bold;
                   margin: 30rpx 0;
				}
				.picker{
					width: 300rpx;
					height: 60rpx;
					line-height: 60rpx;
					border-radius: 8rpx;
					box-sizing: border-box;
					padding-left: 10rpx;
					margin: auto;
					background-color: #eeeeee;
					color: gray;
				}
				.timeline{
					font-size: 28rpx;
					font-weight: bold;
					text-align: center;
					margin-top: 30rpx;
					color: #1A4F8A;
				}
				.tishiline{
					display: flex;
					align-items: center;
				
					width: 80%;
					margin: auto;
						margin-top: 40rpx;
					color: gray;
					font-size: 30rpx;
					.iconfont{
						color: red;
						font-size: 40rpx;
						
					}
				}
				.content{
					width: 80%;
					margin: auto;
					margin-top: 10rpx;
					color: gray;
					font-size: 28rpx;
				}
				.winbtn{
					width: 80%;
					height: 70rpx;
					line-height: 70rpx;
					color: white;
					text-align: center;
					font-size: 30rpx;
					border-radius: 35rpx;
					background: #1A4F8A;
					margin: 40rpx auto;
				}
				
			}
			
			
		}
	}
	
	
}
</style>
